<?php

/**
 * ChangeLogs filter form.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ChangeLogsFormFilter extends BaseChangeLogsFormFilter
{
  public function configure()
  {
      
      $model_name_arr = ChangeLogsTable::$loggable_models;
      array_unshift($model_name_arr, ' ');
      $this->widgetSchema['model_name'] = new sfWidgetFormChoice(array('choices'=>  $model_name_arr));
      $this->validatorSchema['model_name'] = new sfValidatorChoice(array('required'=>false, 'choices'=>  array_keys(ChangeLogsTable::$loggable_models)));
      
      $this->widgetSchema['model_id']  = new sfWidgetFormFilterInput(array('with_empty'=>false));
      $this->widgetSchema['version_id']  = new sfWidgetFormFilterInput(array('with_empty'=>false));
      $this->widgetSchema['modification_time'] = new sfWidgetFormFilterDate(array('from_date' => new sfHijreeDateWidget(), 'to_date' => new sfHijreeDateWidget(),
          'template'=> I18nUtilities::__('From').' %from_date%<br/>'.I18nUtilities::__('To').' %to_date%',
          'with_empty'=>false));
  }
  
    public function getFields()
  {
    return array(
      'id'                => 'Number',
      'version_id'        => 'Number',
      'model_name'        => 'Enum',
      'model_id'          => 'Number',
      'field_name'        => 'Text',
      'old_value'         => 'Text',
      'new_value'         => 'Text',
      'modification_time' => 'Date',
    );
  }
}
